package ar.com.ctrln.view.dashboard.compras.compra;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventQueue;
import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.VariableResolver;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class)
public class RegistrarReclamoController extends SelectorComposer<Component>{

		
	/**
	 * 
	 */
	private static final long serialVersionUID = 1590843458562617527L;

	@Wire
	private Window wRegistrarReclamo;
		
	@Wire
	private Textbox tbDescripcion;
	
	private EventQueue<Event> env = EventQueues.lookup("sendReclamo", EventQueues.DESKTOP, true);
		
	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
	}
		
	@Listen("onClick = #btnRegistrarReclamo")
    public void guardarReclamo(Event e) {
		env.publish(new Event("onButtonClick", null,tbDescripcion.getValue()));
		wRegistrarReclamo.onClose();
    }
}

